/* 图标题/表标题自动编号 */


/* 章标题自动计数
 * 需要设置属性
 * type: table-title
 * type: figure-title
 * type: 表标题
 * type: 图标题
 */

.title(@value, @content) {
    &[custom-type~="@{value}"] {
        counter-increment: table-counter;

        >div.protyle-attr[contenteditable]::after {
            color: var(--b3-theme-on-surface);
            content: "@{content}\0020" counter(table-counter);
        }
    }
}

.protyle-wysiwyg {
    counter-reset: table-counter 0 figure-counter 0;

    [data-node-id] {

        .title(table-title, "Table");
        .title("表标题", "表");
        .title(figure-title, "Figure");
        .title("图标题", "图");
    }
}
